import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryBizQuestionSendSubject = (params) => {
  params.head.transCode = 'queryBizQuestionSendSubject';
  return request({
    url: '/biz/question/bizQuestionSendSubject/queryBizQuestionSendSubject',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryBizQuestionSendSubjectListPage = (params) => {
  params.head.transCode = 'queryBizQuestionSendSubjectListPage';
  return request({
    url: '/biz/question/bizQuestionSendSubject/queryBizQuestionSendSubjectListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveBizQuestionSendSubject = (params) => {
  params.head.transCode = 'saveBizQuestionSendSubject';
  return request({
    url: '/biz/question/bizQuestionSendSubject/saveBizQuestionSendSubject',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveBizQuestionSendSubjectList = (params) => {
  params.head.transCode = 'saveBizQuestionSendSubjectList';
  return request({
    url: '/biz/question/bizQuestionSendSubject/saveBizQuestionSendSubjectList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateBizQuestionSendSubject = (params) => {
  params.head.transCode = 'saveOrUpdateBizQuestionSendSubject';
  return request({
    url: '/biz/question/bizQuestionSendSubject/saveOrUpdateBizQuestionSendSubject',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateBizQuestionSendSubjectList = (params) => {
  params.head.transCode = 'saveOrUpdateBizQuestionSendSubjectList';
  return request({
    url: '/biz/question/bizQuestionSendSubject/saveOrUpdateBizQuestionSendSubjectList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateBizQuestionSendSubject = (params) => {
  params.head.transCode = 'updateBizQuestionSendSubject';
  return request({
    url: '/biz/question/bizQuestionSendSubject/updateBizQuestionSendSubject',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteBizQuestionSendSubject = (params) => {
  params.head.transCode = 'deleteBizQuestionSendSubject';
  return request({
    url: '/biz/question/bizQuestionSendSubject/deleteBizQuestionSendSubject',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteBizQuestionSendSubjectList = (params) => {
  params.head.transCode = 'deleteBizQuestionSendSubjectList';
  return request({
    url: '/biz/question/bizQuestionSendSubject/deleteBizQuestionSendSubjectList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportBizQuestionSendSubjectExcel = (params) => {
  downloadExcel({
    url: '/biz/question/bizQuestionSendSubject/excelDownload/exportBizQuestionSendSubjectExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
